import request from "@/utils/request";
export function getRoleList(params) {
    return request({
        url: "/permissions/roles/search",
        method: "post",
        data: params
    });
}

export function AddRole(params) {
    return request({
        url: "/permissions/roles",
        method: "post",
        data: params
    });
}

export function editRole(params) {
    return request({
        url: `/permissions/roles/${params.id}`,
        method: "put",
        data: params
    });
}

export function deleteRole(params) {
    return request({
        url: `/permissions/roles/${params.id}`,
        method: "delete",
        data: params
    });
}


export function getRolePermission() {
    return request({
        url: `/permissions/search`,
        method: "post",
    });
}


export function setRolePermission(params) {
    return request({
        url: `/permissions/${params.id}/permissions`,
        method: "put",
        data: params.key
    });
}


export function getRoleMenber(params) {
    return request({
        url: `/permissions/roles/${params.id}/users`,
        method: "post",
        data: params
    });
}

export function getNotRoleMenber(params) {
    return request({
        url: `/permissions/roles/${params.id}/no-users`,
        method: "post",
        data: params
    });
}



export function addRoleUser(params) {
    return request({
        url: `/permissions/roles/${params.id}/add-users`,
        method: "post",
        data: params.key
    });
}

export function removeRoleUser(params) {
    return request({
        url: `/permissions/roles/${params.id}/delete-users`,
        method: "post",
        data: params.key
    });
}



export function serRoleUserCharge(params) {
    return request({
        url: `/permissions/roles/officerInCharge`,
        method: "post",
        data: params
    });
}

